/* AI智能写作辅导软件 - 优化版样式 */

/* 全局样式优化 */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

/* 容器布局优化 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏优化 */
.navbar {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    box-shadow: var(--box-shadow);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: white !important;
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    margin: 0 0.5rem;
    padding: 0.5rem 1rem !important;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.navbar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white !important;
}

/* 用户设置下拉菜单 */
.user-settings {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 0.5rem;
    margin-left: 1rem;
}

.user-settings select {
    background: transparent;
    border: none;
    color: white;
    font-size: 0.9rem;
    min-width: 100px;
}

.user-settings select:focus {
    outline: none;
    box-shadow: none;
}

/* 卡片样式统一 */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-bottom: none;
    padding: 1rem 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* 按钮样式优化 */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    padding: 0.5rem 1.5rem;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8, #6a4190);
    transform: translateY(-1px);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-sm {
    padding: 0.375rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1.125rem;
}

/* 表单样式优化 */
.form-control {
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

/* 网格布局优化 */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* 项目卡片样式 */
.project-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    border-left: 4px solid var(--primary-color);
}

.project-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(0,0,0,0.15);
}

.project-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.project-meta {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.project-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-draft {
    background: #fff3cd;
    color: #856404;
}

.status-writing {
    background: #d4edda;
    color: #155724;
}

.status-completed {
    background: #d1ecf1;
    color: #0c5460;
}

/* 写作页面样式 */
.writing-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.project-header {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--box-shadow);
}

.topic-display {
    margin-top: 1rem;
}

.topic-card {
    background: #f8f9fa;
    border-radius: var(--border-radius);
    padding: 1rem;
    border-left: 4px solid var(--primary-color);
}

.topic-label {
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.topic-text {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
    color: #333;
}

/* 写作阶段导航 */
.writing-stages {
    background: white;
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--box-shadow);
}

.stage-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.stage-btn {
    background: transparent;
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    padding: 1rem 2rem;
    cursor: pointer;
    transition: var(--transition);
    color: #6c757d;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 120px;
}

.stage-btn i {
    font-size: 1.5rem;
}

.stage-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.stage-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* 写作内容区域 */
.writing-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 1.5rem;
    align-items: start;
}

.stage-content {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    display: none;
}

.stage-content.active {
    display: block;
}

.stage-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f8f9fa;
}

.stage-header h5 {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.stage-textarea {
    min-height: 600px;
    height: 600px;
    max-height: 90vh;
    resize: vertical;
    font-family: 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.8;
    padding: 25px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    width: 100%;
}

/* AI助手面板 */
.ai-assistant {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.ai-header {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
    padding: 1rem 1.5rem;
    font-weight: 600;
}

.ai-content {
    padding: 1.5rem;
}

.ai-actions {
    margin-bottom: 1.5rem;
}

.ai-actions .btn {
    margin-bottom: 0.5rem;
}

.ai-feedback {
    background: #f8f9fa;
    border-radius: var(--border-radius);
    padding: 1rem;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
}

/* 写作统计 */
.writing-stats {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
}

.writing-stats h6 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: #333;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f8f9fa;
}

.stat-label {
    font-weight: 500;
    color: #6c757d;
}

.stat-value {
    font-weight: 600;
    color: #333;
}

.progress {
    width: 100px;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    height: 100%;
    transition: width 0.3s ease;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .writing-content {
        grid-template-columns: 1fr;
    }
    
    .stage-nav {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .stage-btn {
        min-width: 100px;
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .writing-container {
        padding: 15px;
    }
    
    .project-header {
        padding: 1rem;
    }
    
    .stage-nav {
        flex-direction: column;
    }
    
    .stage-btn {
        width: 100%;
        flex-direction: row;
    justify-content: center;
    }
    
    .stage-textarea {
        min-height: 300px;
    }
    
    .user-dropdown {
        min-width: 280px;
        max-height: 70vh;
    }
    
    .quick-settings,
    .ai-settings {
        margin: 0.25rem;
        padding: 0.5rem;
    }
}

@media (max-width: 576px) {
    .navbar-nav {
        text-align: center;
    }
    
    .user-settings {
        margin: 0.5rem 0;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .hero-button {
        display: block;
        margin: 0.5rem 0;
        width: 100%;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* 加载状态 */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 提示信息样式 */
.alert {
    border-radius: var(--border-radius);
    border: none;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: var(--border-radius);
    padding: 0.5rem;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.875rem;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 用户头像样式 */
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
}

.user-avatar-large {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.125rem;
}

/* 用户下拉菜单样式 */
.user-dropdown {
    min-width: 320px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border: none;
    border-radius: var(--border-radius);
}

.user-dropdown .dropdown-header {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    position: sticky;
    top: 0;
    z-index: 1;
}

.user-dropdown .dropdown-item-text {
    padding: 0;
    background: #f8f9fa;
}

.quick-settings,
.ai-settings {
    background: white;
    border-radius: var(--border-radius);
    margin: 0.5rem;
    padding: 0.75rem;
    border: 1px solid #e9ecef;
}

.quick-settings .fw-semibold,
.ai-settings .fw-semibold {
    font-size: 0.8rem;
    color: #495057;
}

.user-dropdown .form-select,
.user-dropdown .form-control {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.user-dropdown .form-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.user-dropdown .dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    transition: var(--transition);
}

.user-dropdown .dropdown-item:hover {
    background: #f8f9fa;
    padding-left: 1.5rem;
}

.user-dropdown .dropdown-item i {
    width: 16px;
    text-align: center;
}

/* 导航栏固定样式 */
.navbar.fixed-top {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* 主内容区域样式 */
.main-content {
    padding-top: 100px; /* 增加顶部间距，避免被导航栏遮挡 */
    min-height: calc(100vh - 100px);
}

/* 面包屑导航样式 */
.breadcrumb-nav {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e9ecef;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
    margin-top: -20px; /* 减少与主内容的间距 */
}

.breadcrumb {
    margin-bottom: 0;
    font-size: 0.875rem;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb-item a:hover {
    color: var(--secondary-color);
}

.breadcrumb-item.active {
    color: #6c757d;
}

/* 页脚样式优化 */
.footer {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-title {
    font-weight: 600;
    margin-bottom: 1rem;
    color: white;
}

.footer-description {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: white;
    padding-left: 0.5rem;
}

.social-links {
    display: flex;
        gap: 1rem;
    }
    
.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: var(--transition);
    font-size: 1.125rem;
}

.social-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateY(-2px);
}

.footer-divider {
    border-color: rgba(255, 255, 255, 0.2);
    margin: 2rem 0 1rem;
}

.footer-copyright {
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    font-size: 0.9rem;
}

.footer-meta {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
}

.footer-separator {
    margin: 0 0.5rem;
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

/* 全局加载遮罩 */
.global-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.loading-text {
    color: #666;
    font-size: 1rem;
    margin: 0;
}

/* 加载进度条 */
.loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    z-index: 10001;
    transform: translateX(-100%);
    animation: loading-progress 2s ease-in-out;
}

@keyframes loading-progress {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(-20%); }
    100% { transform: translateX(0); }
}

/* 跳转链接（无障碍） */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 10000;
    transition: var(--transition);
}

.skip-link:focus {
    top: 6px;
    color: white;
}

/* 提示容器 */
.alert-container {
    position: fixed;
    top: 80px;
    right: 1rem;
    z-index: 9999;
    max-width: 400px;
}

.alert-container .alert {
    margin-bottom: 0.5rem;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 主题切换按钮 */
.nav-item .btn-link {
    color: rgba(255, 255, 255, 0.9) !important;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.nav-item .btn-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white !important;
}

/* 移动端导航优化 */
.navbar-toggler {
    border: none;
    padding: 0.25rem 0.5rem;
    color: rgba(255, 255, 255, 0.9);
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* 品牌标识优化 */
.brand-text {
    font-weight: 700;
    letter-spacing: -0.5px;
}

.navbar-brand:hover {
    transform: scale(1.02);
}